import axios from "/@/utils/http/axios";
import {MethodEnum} from "/@/utils/http/axios/enum/method-enum";
import {PageModel} from "/@/api/system/model/CommonModel";
import {PostModel, PostQueryModel} from "/@/api/system/model/PostModel";

/**
 * 分页查询职位列表
 * @param isHint
 * @param callBack
 */
export function listPostPage(data: PostQueryModel,callBack?: Function):Promise<PageModel<PostModel[]>> {
    return axios.httpRequest("/system/post/listPostPage", MethodEnum.GET, data, {callBack});
}


/**
 * 新增职位
 * @param callBack
 */
export function insertPost(data: PostModel,callBack?: Function):Promise<void> {
    return axios.httpRequest("/system/post/insertPost", MethodEnum.POST, data, {callBack});
}

/**
 * 修改职位
 * @param callBack
 */
export function updatePost(data: PostModel,callBack?: Function):Promise<void> {
    return axios.httpRequest("/system/post/updatePost", MethodEnum.POST, data, {callBack});
}

/**
 * 根据职位id删除职位
 * @param data
 * @param callBack
 */
export function deletePostByPostId(postId: string,callBack?: Function):Promise<void> {
    return axios.httpRequest("/system/post/deletePostByPostId", MethodEnum.GET, {postId}, {callBack});
}

/**
 * 根据职位id查询职位
 * @param postId
 * @param callBack
 */
export function selectPostByPostId(postId: string,callBack?: Function):Promise<PostModel> {
    return axios.httpRequest("/system/post/selectPostByPostId", MethodEnum.GET, {postId}, {callBack});
}

/**
 * 查询所有职位列表
 * @param isHint
 * @param callBack
 */
export function listPostAll(callBack?: Function):Promise<PostModel[]> {
    return axios.httpRequest("/system/post/listPostAll", MethodEnum.GET, {}, {callBack});
}

